\(\int (a+b x+c x^2)^2 \, dx\) [2122]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 12, antiderivative size = 46 \[ \int \left (a+b x+c x^2\right )^2 \, dx=a^2 x+a b x^2+\frac {1}{3} \left (b^2+2 a c\right ) x^3+\frac {1}{2} b c x^4+\frac {c^2 x^5}{5} \]

[Out]

a^2*x+a*b*x^2+1/3*(2*a*c+b^2)*x^3+1/2*b*c*x^4+1/5*c^2*x^5

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 46, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.083, Rules used = {625} \[ \int \left (a+b x+c x^2\right )^2 \, dx=a^2 x+\frac {1}{3} x^3 \left (2 a c+b^2\right )+a b x^2+\frac {1}{2} b c x^4+\frac {c^2 x^5}{5} \]

[In]

Int[(a + b*x + c*x^2)^2,x]

[Out]

a^2*x + a*b*x^2 + ((b^2 + 2*a*c)*x^3)/3 + (b*c*x^4)/2 + (c^2*x^5)/5

Rule 625

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Int[ExpandIntegrand[(a + b*x + c*x^2)^p, x], x] /;
FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0] && IGtQ[p, 0] && (EqQ[a, 0] ||  !PerfectSquareQ[b^2 - 4*a*c])

Rubi steps \begin{align*} \text {integral}& = \int \left (a^2+2 a b x+b^2 \left (1+\frac {2 a c}{b^2}\right ) x^2+2 b c x^3+c^2 x^4\right ) \, dx \\ & = a^2 x+a b x^2+\frac {1}{3} \left (b^2+2 a c\right ) x^3+\frac {1}{2} b c x^4+\frac {c^2 x^5}{5} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 46, normalized size of antiderivative = 1.00 \[ \int \left (a+b x+c x^2\right )^2 \, dx=a^2 x+a b x^2+\frac {1}{3} \left (b^2+2 a c\right ) x^3+\frac {1}{2} b c x^4+\frac {c^2 x^5}{5} \]

[In]

Integrate[(a + b*x + c*x^2)^2,x]

[Out]

a^2*x + a*b*x^2 + ((b^2 + 2*a*c)*x^3)/3 + (b*c*x^4)/2 + (c^2*x^5)/5

Maple [A] (verified)

Time = 2.97 (sec) , antiderivative size = 41, normalized size of antiderivative = 0.89

method result size
default \(a^{2} x +a b \,x^{2}+\frac {\left (2 a c +b^{2}\right ) x^{3}}{3}+\frac {b c \,x^{4}}{2}+\frac {x^{5} c^{2}}{5}\) \(41\)
norman \(\frac {x^{5} c^{2}}{5}+\frac {b c \,x^{4}}{2}+\left (\frac {2 a c}{3}+\frac {b^{2}}{3}\right ) x^{3}+a b \,x^{2}+a^{2} x\) \(42\)
gosper \(\frac {1}{5} x^{5} c^{2}+\frac {1}{2} b c \,x^{4}+\frac {2}{3} a c \,x^{3}+\frac {1}{3} b^{2} x^{3}+a b \,x^{2}+a^{2} x\) \(43\)
risch \(\frac {1}{5} x^{5} c^{2}+\frac {1}{2} b c \,x^{4}+\frac {2}{3} a c \,x^{3}+\frac {1}{3} b^{2} x^{3}+a b \,x^{2}+a^{2} x\) \(43\)
parallelrisch \(\frac {1}{5} x^{5} c^{2}+\frac {1}{2} b c \,x^{4}+\frac {2}{3} a c \,x^{3}+\frac {1}{3} b^{2} x^{3}+a b \,x^{2}+a^{2} x\) \(43\)

[In]

int((c*x^2+b*x+a)^2,x,method=_RETURNVERBOSE)

[Out]

a^2*x+a*b*x^2+1/3*(2*a*c+b^2)*x^3+1/2*b*c*x^4+1/5*x^5*c^2

Fricas [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 40, normalized size of antiderivative = 0.87 \[ \int \left (a+b x+c x^2\right )^2 \, dx=\frac {1}{5} \, c^{2} x^{5} + \frac {1}{2} \, b c x^{4} + a b x^{2} + \frac {1}{3} \, {\left (b^{2} + 2 \, a c\right )} x^{3} + a^{2} x \]

[In]

integrate((c*x^2+b*x+a)^2,x, algorithm="fricas")

[Out]

1/5*c^2*x^5 + 1/2*b*c*x^4 + a*b*x^2 + 1/3*(b^2 + 2*a*c)*x^3 + a^2*x

Sympy [A] (verification not implemented)

Time = 0.02 (sec) , antiderivative size = 42, normalized size of antiderivative = 0.91 \[ \int \left (a+b x+c x^2\right )^2 \, dx=a^{2} x + a b x^{2} + \frac {b c x^{4}}{2} + \frac {c^{2} x^{5}}{5} + x^{3} \cdot \left (\frac {2 a c}{3} + \frac {b^{2}}{3}\right ) \]

[In]

integrate((c*x**2+b*x+a)**2,x)

[Out]

a**2*x + a*b*x**2 + b*c*x**4/2 + c**2*x**5/5 + x**3*(2*a*c/3 + b**2/3)

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 45, normalized size of antiderivative = 0.98 \[ \int \left (a+b x+c x^2\right )^2 \, dx=\frac {1}{5} \, c^{2} x^{5} + \frac {1}{2} \, b c x^{4} + \frac {1}{3} \, b^{2} x^{3} + a^{2} x + \frac {1}{3} \, {\left (2 \, c x^{3} + 3 \, b x^{2}\right )} a \]

[In]

integrate((c*x^2+b*x+a)^2,x, algorithm="maxima")

[Out]

1/5*c^2*x^5 + 1/2*b*c*x^4 + 1/3*b^2*x^3 + a^2*x + 1/3*(2*c*x^3 + 3*b*x^2)*a

Giac [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 42, normalized size of antiderivative = 0.91 \[ \int \left (a+b x+c x^2\right )^2 \, dx=\frac {1}{5} \, c^{2} x^{5} + \frac {1}{2} \, b c x^{4} + \frac {1}{3} \, b^{2} x^{3} + \frac {2}{3} \, a c x^{3} + a b x^{2} + a^{2} x \]

[In]

integrate((c*x^2+b*x+a)^2,x, algorithm="giac")

[Out]

1/5*c^2*x^5 + 1/2*b*c*x^4 + 1/3*b^2*x^3 + 2/3*a*c*x^3 + a*b*x^2 + a^2*x

Mupad [B] (verification not implemented)

Time = 0.02 (sec) , antiderivative size = 41, normalized size of antiderivative = 0.89 \[ \int \left (a+b x+c x^2\right )^2 \, dx=a^2\,x+x^3\,\left (\frac {b^2}{3}+\frac {2\,a\,c}{3}\right )+\frac {c^2\,x^5}{5}+a\,b\,x^2+\frac {b\,c\,x^4}{2} \]

[In]

int((a + b*x + c*x^2)^2,x)

[Out]

a^2*x + x^3*((2*a*c)/3 + b^2/3) + (c^2*x^5)/5 + a*b*x^2 + (b*c*x^4)/2